package jnpf.engine.enums;

/**
 * @author Doctor4JavaEE
 * @since 2024/3/20
 */
public enum FieldValueTypeEnums {
    FROM_FORM(1, "来自表单字段"),
    FORM_CUSTOM(2, "自定义"),
    FORM_BASE(3, "来自基础的的内置的一些字段"),
    FROM_APPROVER_NODE(4, "来自于审批节点"),
    FROM_OTHER_NODE(5, "来自于其他节点"),
    FROM_PARAM(6, "来自于发起节点的参数管理")
    ;

    private int code;
    private String message;

    FieldValueTypeEnums(int code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     * 根据状态code获取枚举名称
     *
     * @return
     */
    public static FieldValueTypeEnums getByCode(Integer code) {
        for (FieldValueTypeEnums status : FieldValueTypeEnums.values()) {
            if (status.getCode().equals(code)) {
                return status;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
